/*
 * Copyright 2011 Angel Sanadinov
 *
 * This file is part of VBox WMI.
 *
 * VBox WMI is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VBox WMI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VBox WMI.  If not, see <http://www.gnu.org/licenses/>.
 */

package Beans.Requests.MachineManagement.Components;

import org.virtualbox_3_2.AudioControllerType;
import org.virtualbox_3_2.AudioDriverType;

/**
 * This class represents the audio settings of a virtual machine.
 *
 * @author Angel Sanadinov
 */
public class AudioSettings extends MachineManagementComponent
{
    private boolean adapterState;               //the state of the audio adapter
    private AudioControllerType controllerType; //audio controller
    private AudioDriverType driverType;         //audio driver type

    /**
     * Constructs an audio settings object with the specified data.
     *
     * @param adapterState state of the audio adapter
     * @param controllerType audio controller type
     * @param driverType audio driver type
     */
    public AudioSettings(boolean adapterState, AudioControllerType controllerType, AudioDriverType driverType)
    {
        this.adapterState = adapterState;
        this.controllerType = controllerType;
        this.driverType = driverType;
    }

    /**
     * Retrieves the state of the audio adapter.
     *
     * @return <code>true</code> if the adapter is enabled or <code>false</code> if not
     */
    public boolean getAdapterState()
    {
        return adapterState;
    }

    /**
     * Retrieves the audio controller type.
     *
     * @return the audio controller type
     */
    public AudioControllerType getControllerType()
    {
        return controllerType;
    }

    /**
     * Retrieves the audio driver type.
     *
     * @return the audio driver type
     */
    public AudioDriverType getDriverType()
    {
        return driverType;
    }

    @Override
    public boolean isValid()
    {
        if(controllerType != null && driverType != null)
            return true;
        else
            return false;
    }
}
